import {getAxios} from "./service";

let axios=getAxios()
export let jobApi={
  getAllJobByUserId(userId) {
    return axios.get("/api/job/all").then(resp=>resp.data)
  },
  getAllJobByClassify(classify) {
    return axios.get("/api/job/all/"+classify).then(resp=>resp.data)
  },
  getOldestJob(){

  },
  collectOneJob(jobId,collect){
    return axios.get("/api/job/collect/"+jobId+"/"+(collect?1:0)).then(resp=>resp.data)
  },
  getCollectedJob(){
    return axios.get("/api/job/all/collect").then(resp=>resp.data)
  },
  getNearExpireJob(){

  },
  getWhereJob(){

  },
  getTodayJob(){
    return axios.get("/api/job/all/day/1").then(resp=>resp.data)
  },
  insertOneJob(job){
    return axios.post("/api/job/add",{
      ...job
    }).then(resp=>resp.data)
  },
  deleteOneJob(jobId){
    return axios.get("/api/job/del/"+jobId).then(resp=>resp.data)
  }
}

